package org.alex.samples.dao;

import java.util.ArrayList;
import java.util.List;

import org.alex.samples.model.ExamUserSub;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
@Transactional
public class ExamUserSubDAOImpl  extends BaseHibernateDAO<ExamUserSub> implements IExamUserSubDAO {
	
	
	@Override
	public List<ExamUserSub> getAllSubjectByUser(String userId) {
		String hql="from ExamUserSub";
		List<ExamUserSub> eusList = this.find(hql);
		List<ExamUserSub> resultList = new ArrayList<ExamUserSub>();
		for(ExamUserSub list : eusList){
			if(list.getUserId().equals(userId)){
				resultList.add(list);
			}
		}
		return resultList;
	}

}
